import time

def timer(func):
    def deco():
        start = time.time()
        func()
        end = time.time()
        print("func run time is %s"%(end-start))
    return  deco

@timer
def test1():
    time.sleep(3)
    print("run in test1")

test1()